package com.alter.zhang.userprovider.controller;

import com.alter.zhang.userprovider.entity.WXUser;
import com.alter.zhang.userprovider.impl.WXUserServiceImpl;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {

  /*  @RequestMapping("/{phone}/{password}")
    public boolean login(@PathVariable String phone, @PathVariable String password) {
        WXUserServiceImpl service = new WXUserServiceImpl();
        //TODO
        WXUser wxUser = service.selectByPhone(phone);
        if (wxUser == null) {
            return false;
        }
        return true;
    }

    @RequestMapping("/{phone}/{password}")
    public int register(@PathVariable String phone, @PathVariable String password) {
        //排查TODO

        WXUser user = new WXUser();
        user.setUserPhone(phone);
        user.setUserPwd(password);
        WXUserServiceImpl userService = new WXUserServiceImpl();
        return userService.insert(user);
    }*/
}
